/**
 * 
 */
package org.xlab.baseframework.test.platform.webservice.api;

import javax.jws.WebParam;
import javax.jws.WebService;

import org.xlab.baseframework.exception.PermissionDeniedException;
import org.xlab.baseframework.exception.SystemException;

/**
 * @author makubex
 * 
 */
@WebService
public interface ISystemWebService {

	/**
	 * 登录系统的WebService
	 * 
	 * @param userName
	 *            用户名
	 * @param password
	 *            密码
	 * @param deviceId
	 *            設備標識
	 * @return sessionId
	 * @throws PermissionDeniedException
	 *             如果用户名和密码相同
	 */
	public String login(@WebParam(name = "userName") String userName,
			@WebParam(name = "password") String password,
			@WebParam(name = "deviceId") String deviceId)
			throws PermissionDeniedException;

	/**
	 * 登出系统
	 * 
	 * @param sessionId
	 * @param deviceId
	 *            设备标识
	 * @throws PermissionDeniedException
	 *             如果没有登出的权限
	 * @throws SystemException
	 *             如果有其他异常发生
	 */
	public void logout(@WebParam(name = "sessionId") String sessionId,
			@WebParam(name = "deviceId") String deviceId)
			throws PermissionDeniedException, SystemException;

	/**
	 * 测试系统联通性，执行该服务后将更新lastupdatetime值
	 * 
	 * @param sessionId
	 * @throws SystemException
	 *             如果发生任何异常
	 */
	public void ping(@WebParam(name = "sessionId") String sessionId,
			@WebParam(name = "deviceId") String deviceId)
			throws SystemException;
}
